package com.tul.exercise.base.innerclass.chapter10_5;

import com.tul.exercise.base.innerclass.chapter10_4.Destination;

/**
 * @Description 《java编程思想》10.5 示例 1
 *  方法的内部类
 **/
public class Pacel5 {
    public Destination destination(String s) {
        // 不需要private、public or protect
        class PDestination implements Destination{

            private PDestination(String whereTo) {
                label = whereTo;
            }
            private String label;
            @Override
            public String readLabel() {
                return label;
            }
        }

        return new PDestination(s);
    }
}
